Ext.define('extjs6test.view.core.JurisdictionManagerController', {
    extend: 'extjs6test.view.base.BaseManagerController',
    alias: 'controller.jurismngr',
    requires: [
        'extjs6test.view.core.JurisdictionEditWindow'
    ],
    onBaseQuery: function (button, evt) {
        var store = button.up('panel').down('grid').getStore();
        this.callParent(arguments);
    },
    onBaseAdd: function (button, evt) {
        var store = button.up('panel').down('grid').getStore();
        var record = Ext.create(store.model);
        var addWin = new extjs6test.view.core.JurisdictionEditWindow({formStore: store,formRecord:record});
        addWin.show();
    },
    onTreePanelRender: function (tree) {
        tree.getStore().load();
    },
    onTreeItemSelect: function (tree, record, index, eOpts) {
        var store = this.lookupReference("jurisGrid").getStore();
        // console.log(record.get("id"));
        store.getProxy().setExtraParam("juriParentId",record.get("id"));
    }
});